package com.situ.mall.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.situ.mall.entity.Cart;

public interface CartMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

	List<Cart> selectByUserId(Integer id);

	int updateQuantity(@Param(value = "cartId")Integer cartId,@Param(value = "num") Integer num);

	Cart selectByUserIdAndProductId(@Param(value = "userId")Integer userId, @Param(value = "productId")Integer productId);

	int updateCheckStatus(@Param(value = "cartId")Integer cartId,@Param(value = "checked") Integer checked);

	List<Cart> selectByUserIdAndChecked(Integer id);

	void deleteByUserIdAndChecked(Integer userId);
}